// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawMemoryChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawMemoryChart() {
  // Create the data table.
  var dataMemoryChart = new google.visualization.DataTable();
  dataMemoryChart.addColumn('string', 'Memory');
  dataMemoryChart.addColumn('number', 'MB');
  dataMemoryChart.addRows([
    ['Used', {{ status['memory_usage']['used_memory'] }}],
    ['Free', {{ status['memory_usage']['free_memory'] }}],
    ['Wasted', {{ status['memory_usage']['wasted_memory'] }}],
  ]);

  // Set chart options
  var optionsMemoryChart = {'title':'Memory Usage',
    'width':400,
    'height':300};

  // Instantiate and draw our chart, passing in some options.
  var chartMemoryChart = new google.visualization.PieChart(document.getElementById('memchart_div'));
  chartMemoryChart.draw(dataMemoryChart, optionsMemoryChart);
}
